package com.area.cth.pojo;

import com.area.cth.anno.DealState;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Deal implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private Integer goodsId;

    @DealState
    private String state;

    private Integer seller;

    private Integer buyer;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private Goods goods;

    @TableField(exist = false)
    private User sellerUser;

    @TableField(exist = false)
    private User buyerUser;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
